<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>修改用户信息</title>
    {include file="include/top"}
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-app-form-tags"
     style="padding: 20px 0 0 0;">
  {include file="include/input" readonly='readonly' class2='layui-form-item' type='text' title="账号" name='username' value='<?php echo isset($data["username"])?$data["username"]:"";?>'}
  {include file="include/input" readonly='readonly' class2='layui-form-item' type='text' title="名称" name='title' value='<?php echo isset($data["title"])?$data["title"]:"";?>'}
  {include file="include/input" readonly='readonly' class2='layui-form-item' type='text' title="联系人" name='contacts' value='<?php echo isset($data["contacts"])?$data["contacts"]:"";?>'}
  {include file="include/input" readonly='readonly' class2='layui-form-item' type='text' title="手机" name='mobile' value='<?php echo isset($data["mobile"])?$data["mobile"]:"";?>'}
  {include file="include/input" class2='layui-form-item' type='number' title="充值金额" name='amount' value='<?php echo isset($data["amount"])?$data["amount"]:"";?>'}
    {include file="include/selectsearch" ctype='layui-form-item' title="收款方式" classname='pays' optionHtml='<?php echo isset($pays)?$pays:"";?>' }
     <div class="layui-form-item">
        <label class="layui-form-label">相关截图</label>
        <div class="layui-input-inline">
            <input type="text" name="img" id="import" value="{$data.img?$data.img:''}" lay-verify="required" placeholder="请输入img" autocomplete="off" class="layui-input">
            <br>
            <img src="{$data.img?$data.img:''}" id="img2" style="max-height: 100px;max-width: 100px;">
        </div>
    </div>
</div>

{include file="include/js"}
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'upload'], function () {
        var $ = layui.$;
        var form = layui.form;
        var upload = layui.upload
        upload.render({
            elem: '#import'
            ,url: '/includes/upload' //改成您自己的上传接口
            ,before:function () {
                $load = layer.load();
            }
            ,auto: true
            ,exts: 'jpg|png' //只允许上传压缩文件
            //,multiple: true
            // ,bindAction: '#test9'
            ,done: function(res){
                layer.closeAll();
                if(res.code==1){
                    layer.msg(res.src);
                }else{
                    layer.msg('上传成功');
                    $("#import").val(res.data.src);
                    $("#img2").attr("src",res.data.src);
                }
            },error:function () {
                layer.closeAll();
            }
        });
    });
</script>
</body>
</html>